﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;

namespace Migraine
{
    public partial class FrmLogin : Form
    {
        public FrmLogin()
        {
            InitializeComponent();
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

        private void ShowForm2()
        {

            FrmHome f = new FrmHome();
            f.Activate();
            f.ShowDialog();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text != null && textBox2.Text != null)
            {
                Thread thread = new Thread(new ThreadStart(ShowForm2)); //Tạo luồng mới
                thread.Start(); //Khởi chạy luồng
                this.Close(); //đóng Form hiện tại. (Form1)
            }
            else MessageBox.Show("Wrong password");

        }
    }
}
